import request from '@/utils/request'

// 查询补贴政策列表
export function listPolicy(query) {
  return request({
    url: '/yjnb/policy/list',
    method: 'get',
    params: query
  })
}

// 查询补贴政策详细
export function getPolicy(id) {
  return request({
    url: '/yjnb/policy/' + id,
    method: 'get'
  })
}

// 新增补贴政策
export function addPolicy(data) {
  return request({
    url: '/yjnb/policy',
    method: 'post',
    data: data
  })
}

// 修改补贴政策
export function updatePolicy(data) {
  return request({
    url: '/yjnb/policy',
    method: 'put',
    data: data
  })
}

// 删除补贴政策
export function delPolicy(id) {
  return request({
    url: '/yjnb/policy/' + id,
    method: 'delete'
  })
}
export function releaseAllowancePolicy(data) {
  return request({
    url:"/yjnb/policy/releaseAllowancePolicy", 
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 取消发布
export function unreleaseAllowancePolicy(data) {
  return request({
    url:"/yjnb/policy/unreleaseAllowancePolicy", 
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 推荐
export function recommendAllowancePolicy(data) {
  return request({
    url:"/yjnb/policy/recommendAllowancePolicy", 
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 取消推荐
export function unrecommendAllowancePolicy(data) {
  return request({
    url:"/yjnb/policy/unrecommendAllowancePolicy", 
        method: "post",
    data: data,
    withLoading: true,
  });
}